package hn.cch.core;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;



public class Station {

    private static Logger logger = LoggerFactory.getLogger(Station.class);


    private String stationNumber;

    public Station(String stationNumber) {
        this.stationNumber = stationNumber;
    }


    public void selectHandle() {
        logger.info("{} select handle start >>>>> ", stationNumber);

        //模拟业务用时
        try {
            int random = (int) (Math.random() * 2);
            logger.info("{} select random : {}", stationNumber, random);
            Thread.sleep(random * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.info("{} select handle stop |<<<<< ", stationNumber);
    }


    public void updateHandle() {
        logger.info("{} update handle start >>>>> ", stationNumber);

        //模拟业务用时
        try {
            int random = (int) (Math.random() * 10);
            logger.info("{} update random : {}", stationNumber, random);
            Thread.sleep(random * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.info("{} update handle stop |<<<<< ", stationNumber);

    }

}
